;:poke56,32:clr
;:sys36864
	*= 8192
	;.opt oo
vic	=$d000
strout	=$ab1e
bsout	=$ffd2
get	=65508
input	=$ffcf
return	=$aad7
quote	=212
key	=198
setnam	=$ffbd
setpar	=$ffba
flop	=8
talk	=$ffb4
sectalk	=$ff96
untalk	=$ffab
fa	=$ba
sa	=$b9
iecin	=$ffa5
open	=$ffc0
close	=$ffc3
clall	=$ffe7
chkin	=$ffc6
clrchn	=$ffcc
axout	=$bdcd
tmp	=2
st	=144
endmem	=$d0
fra	=vic+32
line1	=1904
konf	=1
shift	=653
setcr	=58732
zeile	=214
start	jmp mainstart
hallo	.byte "\x93\x05      **** verify von 2 files ****"
	.byt 13,13
	.byte " (c) nikolaus heusler 0\x8e71187 - (c) nss"
	.byt 13,13
	.byte "              version  1.2"
	.byt 13
	.byte "\x11\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0"
	.byt 13,0
namt1	.byte "name des 1. files ? "
	brk
namt2	.byt 13
	.byte "\x11name des 2. files ? "
	brk
please	.byt 13
	.byte "bitte disk mit \x12file\xa0#"
nr	.byte "\xa6\x92 einlegen !"
	.byt 13,0
star	.byte "\x11startadresse = "
	brk
full	.byte "\x11speicher voll - file zu lang !!"
	.byt 13,0
fina	.byte "\x11endadresse   = "
	brk
text	.byte "\x11\x11\x11\x11\x11\x11\x11\x11\x13\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x111:"
	.byt 13
	.byte "2:"
	.byt 13
	.byte "d:"
	brk
adif	.byte "\x11unterschiede : "
	brk
len1	brk
name1	.word 0,0,0,0,0,0,0,0,0
len2	brk
name2	.word 0,0,0,0,0,0,0,0,0
start1	.word 0
start2	.word 0
fini1	.word 0
over	brk
agsp	brk
dif	.word 0
diskin	stx nr
	lda #<please
	ldy #>please
	jsr strout
waitkey	lda #0
	sta key
wk	cmp key
	beq wk
	dec key
	rts
check	lda #flop
	sta fa
	jsr talk
	lda #$6f
	sta sa
	jsr sectalk
	jsr iecin
	cmp #"0"
	bne qerr
	jsr untalk
	clc
	rts
qerr	pha
	jsr return
	pla
err	jsr bsout
	cmp #13
	beq err0
	jsr iecin
	bne err
err0	jsr untalk
	jsr return
	sec
	rts
in2	ldx #2
	jmp chkin
scroll	sei
	ldy #2
sc	lda line1+1,y
	sta line1,y
	lda line1+41,y
	sta line1+40,y
	lda line1+81,y
	sta line1+80,y
	iny
	cpy #39
	bcc sc
	cli
	ldx #100
	ldy agsp
wt	dex
	bne wt
	dey
	bne wt
	lda shift
	beq rst
	inc agsp
	bpl rtt
	dec agsp
	rts
colin	lda #1
	ldy #119
clin	sta line1+54272,y
	dey
	bpl clin
	iny
	sty line1+54272+39
	sty line1+54272+79
	sty line1+54272+119
	rts
rst	dec agsp
	dec agsp
	beq false
	bpl rtt
false	inc agsp
	inc agsp
rtt	rts
hol1	ldy over
	bne ahja
	lda #54
	sta konf
	lda (tmp),y
	inc konf
	rts
ahja	lda #228
	rts
colout	lda #32
	ldy #119
clou	sta line1,y
	dey
	bpl clou
	lda #15
	sta zeile
	jsr setcr
	jmp return
slower	lda #90
	cmp agsp
	bcc gutd
	sta agsp
gutd	inc dif
	bne sepp
	inc dif+1
sepp	lda #160
	rts
mainstart	lda #0
	sta fra
	sta vic+33
	lda #<hallo
	ldy #>hallo
	jsr strout
	lda #55
	sta konf
files	lda #<namt1
	ldy #>namt1
	jsr strout
er1	ldx #0
	inc quote
	stx dif
	stx dif+1
get1	jsr input
	cmp #13
	beq dz1
	sta name1,x
	inx
	cpx #16
	bcc get1
dz1	txa
	beq er1
	lda #","
	sta name1,x
	lda #"r"
	inx
	sta name1,x
	inx
	stx len1
	lda #<namt2
	ldy #>namt2
	jsr strout
er2	ldx #0
	inc quote
get2	jsr input
	cmp #13
	beq dz2
	sta name2,x
	inx
	cpx #16
	bcc get2
dz2	txa
	beq er2
	lda #","
	sta name2,x
	lda #"r"
	sta name2+1,x
	stx len2
	jsr return
read1	ldx #"1"
	jsr diskin
	lda #2
	jsr close
	jsr clall
	ldx #<name1
	ldy #>name1
	lda len1
	jsr setnam
	ldx #flop
	ldy #2
	tya
	jsr setpar
	lda #2
	jsr open
	jsr check
	bcc nomain
	jmp files
nomain	jsr in2
	jsr get
	sta start1
	jsr get
	sta start1+1
	lda #<star
	ldy #>star
	jsr strout
	ldx start1
	lda start1+1
	jsr axout
	jsr return
	lda #<mem
	ldy #>mem
	sta tmp
	sty tmp+1
loop1	lda st
	bne end1
	jsr get
	sta fra
	ldy #0
	sta (tmp),y
	inc tmp
	bne loop1
	inc tmp+1
	lda tmp+1
	cmp #endmem
	bcc loop1
	jsr clrchn
	lda #<full
	ldy #>full
	jsr strout
	lda #2
	jmp close
end1	lda #0
	sta fra
	lda tmp
	ldy tmp+1
	sta fini1
	sty fini1+1
	jsr clrchn
	lda #2
	jsr close
	lda #<fina
	ldy #>fina
	jsr strout
	lda tmp
	clc
	adc start1
	pha
	lda tmp+1
	adc start1+1
	sta tmp
	pla
	sec
	sbc #<mem
	tax
	lda tmp
	sbc #>mem
	jsr axout
	jsr return
	lda #15
	sta agsp
read2	ldx #"2"
	jsr diskin
	lda #2
	jsr close
	jsr clall
	ldx #<name2
	ldy #>name2
	lda len2
	jsr setnam
	ldx #flop
	ldy #2
	tya
	jsr setpar
	lda #2
	jsr open
	jsr check
	bcc nomain2
	jmp files
nomain2	jsr in2
	jsr get
	sta start2
	jsr get
	sta start2+1
	lda #<star
	ldy #>star
	jsr strout
	ldx start2
	lda start2+1
	jsr axout
	lda #<text
	ldy #>text
	jsr strout
	jsr colin
	lda #<mem
	ldy #>mem
	sta tmp
	sty tmp+1
	lda #0
	sta over
loop2	jsr scroll
	lda st
	bne end2
	jsr get
	sta fra
	sta line1+79
	jsr hol1
	sta line1+39
	cmp line1+79
	bne noequal
	lda over
	bne noequal
	lda #32
	bne eval
noequal	jsr slower
eval	sta line1+119
	inc tmp
	bne loop2a
	inc tmp+1
loop2a	lda tmp+1
	cmp fini1+1
	bcc loop2
	bne over1
	lda tmp
	cmp fini1
	bcc loop2
over1	ror over
	jmp loop2
end2	jsr clrchn
	lda #2
	jsr close
	jsr colout
	lda #<fina
	ldy #>fina
	jsr strout
	lda tmp
	clc
	adc start2
	pha
	lda tmp+1
	adc start2+1
	sta tmp
	pla
	sec
	sbc #<mem
	tax
	lda tmp
	sbc #>mem
	jsr axout
	jsr return
	lda #0
	sta fra
	lda #<adif
	ldy #>adif
	jsr strout
	ldx dif
	lda dif+1
	jsr axout
	jmp return
mem	=*
